<?php
ArrowController::importModel("org.arrowplatform.controls.presentation.table.filters.ArrowTableAbstractFilter");
class ArrowTableSelectFilter extends ArrowAbstractTableFilter{
	
	public function configure(){
		parent::configure();
	}
	public function generateFilter($value){
		$select = $this->getFirstChild("ArrowFormSelect");
		$tmp = explode("_arrow_sep_", $value);
		$select->setProperty("selected", $tmp[0]);
		$select->prependNode( "form", "option", array( "label" => "-- wybierz wartość --", "value" => "__---__" ) ) ;
		$str = $select->generate();
		$str.= '<div class="ctrl-popup-cancel"></div>';
		
		return $str;
	}
	
	public function generateSetFilterValues($value) {
		
		$tmp = explode("_arrow_sep_", $value);
		$str = '';
		if(isset($tmp[1]) && $tmp[0] != "__---__" )
			$str = "<div class=\"ctrl-table-set-filter-value\" >{$tmp[1]}</div><a rel=\"{$this->getResetRegistry()}\" href=\"{$this->getResetLink()}\" ></a>";
		
		return $str;
	}
}
?>